﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cell : MonoBehaviour
{
	public SpriteRenderer render;
	int _colorId;

	public int colorID {
		get { return _colorId; }
		set {
			_colorId = value;
			//render.color = GetColorByID (value);
			render.sprite = GameDefine.instance.listBlockSprites [value];
		}
	}

	Color GetColorByID (int id)
	{
		switch (id) {
		case 5:
			return Color.white;
		case 4:
			return Color.red;
		case 1:
			return Color.blue;
		case 0: 
			return Color.black;
		case 3: 
			return Color.yellow;
		case 2: 
			return Color.green;
		default :
			return Color.black;
		}

	}

}
